In computer graphics, a computer is used to generate digital data that represents the projection of surfaces of objects in, for example, a three-dimensional scene, illuminated by, one or more light sources, onto a two-dimensional image plane, to simulate the recording of the scene by, for example, a camera. The camera may include a lens four projecting the image of the scene onto the image plane, or it may comprise a pinhole camera in which case no lens is used. The two-dimensional image is in the form of an array of picture elements (which are variable termed “pixels” or “pels”), and the digital data generated for each pixel represents the color and luminance of the scene as projected onto the image plane at the point of the respective pixel in the image plane. The surfaces the objects may have any of a number of characteristics, including shape, color, specularity, texture, and so forth, which are preferably rendered in the image as closely as possible, to provide a realistic-looking image.
Generally, the contributions of the light reflected from the various points in the scene to the pixel value representing the color and intensity of a particular pixel are expressed in the form of the one or more integrals of relatively complicated functions. Since the integrals used in computer graphics generally will not have a closed-form solution, numerical methods must be used to evaluate them and thereby generate the pixel value. Typically, a conventional “Monte Carlo” method has been used in computer graphics to numerically evaluate the integrals. Generally, in the Monte Carlo method, to evaluate an integral
                              〈          f          〉                =                              ∫            0            1                    ⁢                                    f              ⁡                              (                x                )                                      ⁢                                                  ⁢                          ⅆ              x                                                          (        1        )            where f(x) is a real function on the real numerical interval from zero to 1, inclusive, first a number “N” statistically-independent random numbers xi, i=1, . . . , N, are generated over the interval. The random numbers xi are used as sample points for which sample values f(xi) are generated for the function f(x), and an estimate f for the integral is generated as
                                          〈            f            〉                    ≈                      f            _                          =                              1            N                    ⁢                                    ∑                              i                =                1                            N                        ⁢                                                  ⁢                          f              ⁡                              (                                  x                  i                                )                                                                        (        2        )            As the number of random numbers used in generating the sample points f(xi) increases, the value of the estimate f will converge toward the actual value of the integral f. Generally, the distribution of estimate values that will be generated for various values of “N,” that is, for various numbers of samples, of being normal distributed around the actual value with a standard deviation σ which can be estimated by
                    σ        =                                            1                              N                -                1                                      ⁢                          (                                                                    f                    2                                    _                                -                                                      f                    _                                    2                                            )                                                          (        3        )            if the values xi used to generate the sample values f(xi) are statistically independent, that is, if the values xi are truly generated at random.
Generally, it has been believed that random methodologies like the Monte Carlo method are necessary to ensure that undesirable artifacts, such as Moirè patterns and aliasing and the like, which are not in the scene, will not be generated in the generated image. However, several problems arise from use of the Monte Carlo method in computer graphics. First, since the sample points xi used in the Monte Carlo method are randomly distributed, they may clump in various regions over the interval over which the integral is to be evaluated. Accordingly, depending on the set of random numbers which are generated, in the Monte Carlo method for significant portions of the interval there may be no sample points xi for which sample values f(xi) are generated. In that case, the error can become quite large. In the context of generating a pixel value in computer graphics, the pixel value that is actually generated using the Monte Carlo method may not reflect some elements which might otherwise be reflected if the sample points xi were guaranteed to be more evenly distributed over the interval. This problem can be alleviated somewhat by dividing the interval into a plurality of sub-intervals, but it is generally difficult to determine a priori the number of sub-intervals into which the interval should be divided, and, in addition, in a multi-dimensional integration region (which would actually be used in computer graphics, instead of the one-dimensional interval described here) the partitioning of the region into sub-regions of equal size can be quite complicated.
In addition, since the method makes use of random numbers, the error | f−f| (where |x| represents the absolute value of the value “x”) between the estimate value f and actual value f is probabilistic, and, since the error values for various large values of “N” are close to normal distribution around the actual value f, only sixty-eight percent of the estimate values f that might be generated are guaranteed to lie within one standard deviation of the actual value f.
Furthermore, as is clear from equation (3), the standard deviation (y decreases with increasing numbers of samples N, proportional to the reciprocal of square root of “N” (that is, 1/√{square root over (N)}). Thus, if it is desired to reduce the statistical error by a factor of two, it will be necessary to increase the number of samples N by a factor of four, which, in turn, increases the computational load that is required to generate the pixel values, for each of the numerous pixels in the image.
Additionally, since the Monte Carlo method requires random numbers, an efficient mechanism for generating random numbers is needed. Generally, digital computers are provided with so-called “random number” generators, which are computer programs which can be processed to generate a set of numbers that are approximately random. Since the random number generators use deterministic techniques, the numbers that are generated are not truly random. However, the property that subsequent random numbers from a random number generator are statistically independent should be maintained by deterministic implementations of pseudo-random numbers on a computer.
The Grabenstein application describes a computer graphics system and method for generating pixel values for pixels in an image using a strictly deterministic methodology for generating sample points, which avoids the above-described problems with the Monte Carlo method. The strictly deterministic methodology described in the Grabenstein application provides a low-discrepancy sample point sequence which ensures, a priori, that the sample points are generally more evenly distributed throughout the region over which the respective integrals are being evaluated. In one embodiment, the sample points that are used are based on a so-called Halton sequence. See, for example, J. H. Halton, Numerische Mathematik, Vol. 2, pp. 84-90 (1960) and W. H. Press, et al., Numerical Recipes in Fortran (2d Edition) page 300 (Cambridge University Press, 1992). In a Halton sequence generated for number base “p,” where base “p” is a selected prime number, the “k-th” value of the sequence, represented by Hpk is generated by use of a “radical inverse” operation, that is, by                (1) writing the value “k” as a numerical representation of the value in the selected base “p,” thereby to provide a representation for the value as DMDM−1 . . . D2D1, where Dm (m=1, 2, . . . , M) are the digits of the representation,        (2) putting a radix point (corresponding to a decimal point for numbers written in base ten) at the least significant end of the representation DMDM−1D2 D1 written in step (1) above, and        (3) reflecting the digits around the radix point to provide 0. D1D2 . . . DM−1DM, which corresponds to Hpk.It will be appreciated that, regardless of the base “p” selected for the representation, for any series of values, one, two, . . . “k,” written in base “p,” the least significant digits of the representation will change at a faster rate than the most significant digits. As a result, in the Halton sequence Hp1, Hp2, . . . Hpk, the most significant digits will change at the faster rate, so that the early values in the sequence will be generally widely distributed over the interval from zero to one, and later values in the sequence will fill in interstices among the earlier values in the sequence. Unlike the random or pseudo-random numbers used in the Monte Carlo method as described above, the values of the Halton sequence are not statistically independent; on the contrary, the values of the Halton sequence are strictly deterministic, “maximally avoiding” each other over the interval, and so they will not clump, whereas the random or pseudo-random numbers used in the Monte Carlo method may clump.        
It will be appreciated that the Halton sequence as described above provides a sequence of values over the interval from zero to one, inclusive along a single dimension. A multi-dimensional Halton sequence can be generated in a similar manner, but using a different base for each dimension.
A generalized Halton sequence, of which the Halton sequence described above is a special case, is generated as follows. For each starting point along the numerical interval from zero to one, inclusive, a different Halton sequence is generated. Defining the pseudo-sum x⊕py for any x and y over the interval from zero to one, inclusive, for any integer “p” having a value greater than two, the pseudo-sum is formed by adding the digits representing “x” and “y” in reverse order, from the most-significant digit to the least-significant digit, and for each addition also adding in the carry generated from the sum of next more significant digits. Thus, if “x” in base “p” is represented by 0.X1X2 . . . XM−1XM, where each “Xm” is a digit in base “p,” and if “y” in base “p” is represented by 0.Y1Y2 . . . YN−1YN, where each “Yn” is a digit in base “p” (and where “M,” the number of digits in the representation of “x” in base “p”, and “N,” the number of digits in the representation of “y” in base “p”, may differ), then the pseudo-sum “z” is represented by 0.Z1Z2 . . . ZL−1ZL, where each “Z1” is a digit in base “p” given by Z1=(X1+Y1+C1) mod p, where “mod” represents the modulo function, and
      C    l    =      {                                                                      1                ⁢                                                                  ⁢                for                ⁢                                                                  ⁢                                  X                                      l                    -                    1                                                              +                              Y                                  l                  -                  1                                            +                              Z                                  l                  -                  1                                                      ≥            p                                                            0            ⁢                                                  ⁢            otherwise                              is a carry value from the “l-1st” digit position, with C1 being set to zero.
Using the pseudo-sum function as described above, the generalized Halton sequence that is used in the system described in the Grabenstein application is generated as follows. If “p” is an integer, and x0 is an arbitrary value on the interval from zero to one, inclusive, then the “p”-adic von Neumann-Kakutani transformation Tp(x) is given by
                                                        T              p                        ⁡                          (              x              )                                :=                      x            ⁢                          ⊕              p                        ⁢                          1              p                                      ,                            (        4        )            and the generalized Halton sequence x0, x1, x2, . . . is defined recursively asxn+1=Tp(xn)  (5)From equations (4) and (5), it is clear that, for any value for “p,” the generalized Halton sequence can provide that a different sequence will be generated for each starting value of “x,” that is, for each x0. It will be appreciated that the Halton sequence Hpk as described above is a special case of the generalized Halton sequence (equations (4) and (5)) for x0=0.
The use of a strictly deterministic low-discrepancy sequence can provide a number of advantages over the random or pseudo-random numbers that are used in connection with the Monte Carlo technique. Unlike the random numbers used in connection with the Monte Carlo technique, the low discrepancy sequences ensure that the sample points are more evenly distributed over a respective region or time interval, thereby reducing error in the image which can result from clumping of such sample points which can occur in the Monte Carlo technique. That can facilitate the generation of images of improved quality when using the same number of sample points at the same computational cost as in the Monte Carlo technique.